local ClientOHOH = _G.ClientOHOH;

local M = ClientOHOH.class.new(script, ClientOHOH.files.BaseObject())
local CallBackManager = ClientOHOH.load.CallBackManager();
local ConnectClass=_G.CommonOHOH.load.Connect();

local instStr={
    allBtn="ctrl.navBtn.All.btn",
    --allSelect="ctrl.navBtn.All.selected",

    bodyBtn="ctrl.navBtn.seat.btn",
    --bodySelect="ctrl.navBtn.Body.selected",

    drillBtn="ctrl.navBtn.bit.btn",
    --drillSelect="ctrl.navBtn.DrillBit.selected",

    tailBtn="ctrl.navBtn.propulsion.btn",
    --tailSelect="ctrl.navBtn.Thruster.selected",
    
    ringBtn="ctrl.navBtn.tire.btn",
    --ringSelect="ctrl.navBtn.Tyre.selected",

    decoBtn="ctrl.navBtn.decoration.btn",
    --decoSelect="ctrl.navBtn.Decoration.selected",
    selectedColor = "ctrl.navBtn.selectedColor",
    defaultColor = "ctrl.navBtn.defaultColor",
}

function M.new(...)
	return M(...);
end;


function M.ctor(self,ctrl)
    M.super.ctor(self);

    self.ctrl=ctrl
    self.ui=ctrl:InitUiInst2(ctrl.main_inst,instStr)

    self.Select = self.ui.allBtn

    --0:全部 1:钻头，2：车轮，3：车身，4：推进器：5 装饰
    CallBackManager:AddRbxConnect(self,self.ui.allBtn.Activated, function()
        if self.Select ~=  self.ui.allBtn then
            self.ctrl.NavChangeEvent:Action(0)

            self.Select.BackgroundColor3 = self.ui.defaultColor
            self.ui.allBtn.BackgroundColor3 = self.ui.selectedColor
            --self.ui.allBtn.Enabled = true
            self.Select =  self.ui.allBtn
        end
	end);
    CallBackManager:AddRbxConnect(self,self.ui.drillBtn.Activated, function()
        if self.Select ~=  self.ui.drillSelect then
            -- self.ctrl.NavChangeEvent:Action(1)
       
            -- self.Select.Enabled = false
            -- self.ui.drillSelect.Enabled = true
            -- self.Select = self.ui.drillSelect

            self.ctrl.NavChangeEvent:Action(1)

            self.Select.BackgroundColor3 = self.ui.defaultColor
            self.ui.drillBtn.BackgroundColor3 = self.ui.selectedColor
            self.Select =   self.ui.drillBtn
        end
	end);
    CallBackManager:AddRbxConnect(self,self.ui.ringBtn.Activated, function()
        if self.Select ~=  self.ui.ringSelect then
            self.ctrl.NavChangeEvent:Action(2)

             self.Select.BackgroundColor3 = self.ui.defaultColor
             self.ui.ringBtn.BackgroundColor3 = self.ui.selectedColor
            self.Select = self.ui.ringBtn
        end
	end);
    CallBackManager:AddRbxConnect(self,self.ui.bodyBtn.Activated, function()
        if self.Select ~=  self.ui.bodySelect then
            self.ctrl.NavChangeEvent:Action(3)

             self.Select.BackgroundColor3 = self.ui.defaultColor
             self.ui.bodyBtn.BackgroundColor3 = self.ui.selectedColor
            self.Select = self.ui.bodyBtn
        end
	end);
    CallBackManager:AddRbxConnect(self,self.ui.tailBtn.Activated, function()
        if self.Select ~=  self.ui.tailSelect then
            self.ctrl.NavChangeEvent:Action(4)

             self.Select.BackgroundColor3 = self.ui.defaultColor
             self.ui.tailBtn.BackgroundColor3 = self.ui.selectedColor
            self.Select =self.ui.tailBtn
        end
	end);
    CallBackManager:AddRbxConnect(self,self.ui.decoBtn.Activated, function()
        if self.Select ~=  self.ui.decoSelect then
            self.ctrl.NavChangeEvent:Action(5)
             self.Select.BackgroundColor3 = self.ui.defaultColor
             self.ui.decoBtn.BackgroundColor3 = self.ui.selectedColor
            self.Select =self.ui.decoBtn
        end
	end);

end


function M.dtor(self)
	end;

function M.IsShowing(self)
    end


function M.Show(self)
end


function M.Hide(self,cell)
end

function M.NavChange(self)

end

function M.CancelSelect(self)

end

function M.Select(self,cell)
   end


function M.Big(self)
end


function M.Small(self)
end

return M